home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
umich
/
music
/
eked-m1.zoo
/
src
/
defs.h
< prev
next >
Wrap
Text File
|
1995-02-19
|
3KB
|
136 lines
/*
* EKED-M1 : Editor for Korg M1 synth; defs.h : global defines
* Copyright (C) 1995 Steven M. Eker (Steven.Eker@brunel.ac.uk)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define FILE_SPEC_SIZE 200
/*
* Korg M1 specific numbers
*/
#define KORG_ID 0x42
#define FORMAT_ID 0x30
#define M1_ID 0x19
/*
* Sizes
*/
#define GLOBAL_SIZE 861
#define COMBINATION_SIZE 124
#define PROGRAM_SIZE 143
#define PROGRAM_OFFSET (GLOBAL_SIZE + 100 * COMBINATION_SIZE)
#define AD_SIZE (31496+3)
#define GD_SIZE 984
#define CD_SIZE 14172
#define PD_SIZE 16343
#define AD50_SIZE (16240+2)
#define CD50_SIZE 7086
#define PD50_SIZE 8172
/*
* Size based functions
*/
#define COMB_DATA(b, n) \
((b)->data + GLOBAL_SIZE + (n) * COMBINATION_SIZE)
#define PROG_DATA(b, n) \
((b)->data + PROGRAM_OFFSET + (n) * PROGRAM_SIZE)
/*
* Modes
*/
#define COMB_MODE 0
#define EDIT_COMB_MODE 1
#define PROG_MODE 2
#define EDIT_PROG_MODE 3
#define GLOBAL_MODE 4
#define SEQ_MODE 6
/*
* Sysex function codes
*/
#define PROG_DUMP 0x40
#define COMB_DUMP 0x49
#define GLOBAL_DATA_DUMP 0x51
#define ALL_PROG_DUMP 0x4C
#define ALL_COMB_DUMP 0x4D
#define ALL_DATA_DUMP 0x50
#define PARAMETER_CHANGE 0x41
#define MODE_CHANGE 0x4E
#define DATA_LOAD_OK 0x23
#define DATA_LOAD_ERR 0x24
#define GLOBAL_DATA_REQ 0x0E
#define MODE_REQ 0x12
#define ALL_PROG_REQ 0x1C
#define ALL_COMB_REQ 0x1D
/*
* TX/RX flags
*/
#define TX_GLOB 1
#define TX_COMB 2
#define TX_PROG 4
#define TX_CARD 8
#define TX_ONE 16
/*
* M1 control stuff
*/
#define EXITING 1
#define FORCE_MODE 2
#define FORCE_NR 4
#define FORCE_DATA 8
/*
* User window messages
*/
#define M1_CTRL_LOST 0
#define UPDATE_ITEM 1
/*
* Default return values
*/
#define SUCCESS 0
#define FAILURE (-1)
/*
* Macros
*/
#define EXTRACT_BIT(v, i) (((v) & (1 << (i))) != 0)
#define REPLACE_BIT(v, i, j) ((v) ^ (((v) ^ ((j) << (i))) & (1 << (i))))
#define EXTRACT_2LO(v) ((v) & 3)
#define REPLACE_2LO(v, i) (((v) & ~3) | (i))
#define EXTRACT_56(v) (((v) >> 5) & 3)
#define EXTRACT_NYBLE(v) ((v) & 0xF)
#define REPLACE_NYBLE(v, i) (((v) & ~0xF) | i)
#define INSIDE(x, y, box) ((x) >= (box).v_x1 && (x) <= (box).v_x2 && \
(y) >= (box).v_y1 && (y) <= (box).v_y2 )
#define OBJECT_TO_GRECT(ob) ((GRECT *) &((ob)->ob_x))
#define MESSAGE_TO_GRECT(m) ((GRECT *) &((m)[4]))
#define TEXT_PTR(form, ob) (((TEDINFO *) (form)[ob].ob_spec)->te_ptext)
#define STRING_PTR(form, ob) ((char *) (form)[ob].ob_spec)
#define LBAL (-1)
#define RBAL (-2)
#define SBAL (-3)
#define NIL (-1)